import { IsString, IsNotEmpty, IsOptional, IsNumber } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

export class CreatePermissionDto {
  @ApiProperty({ description: '权限名称', example: '创建用户' })
  @IsString()
  @IsNotEmpty()
  name: string;

  @ApiProperty({ description: '权限代码', example: 'user:create' })
  @IsString()
  @IsNotEmpty()
  code: string;

  @ApiPropertyOptional({ description: '权限描述' })
  @IsString()
  @IsOptional()
  description?: string;

  @ApiPropertyOptional({ description: '权限类型', example: 'menu' })
  @IsString()
  @IsOptional()
  type?: string;

  @IsNumber()
  @IsOptional()
  status?: number;
} 